using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Departure.Webservice.Methods;

namespace Departure
{
    public partial class FormMain : Form
    {
        Departure.Webservice.WebserviceWrapper ws;

        public FormMain()
        {
            InitializeComponent();
        }

        private void FormMain_Load(object sender, EventArgs e)
        {
            ws = new Departure.Webservice.WebserviceWrapper();
        }

        private void buttonFindStation_Click(object sender, EventArgs e)
        {
            ws.setURL(textBoxURL.Text);
            List<string> result = ws.FindStation("3FBF5000-7351-0801-1706-8AB2475903EB", textBoxInput.Text);

            StringBuilder sb = new StringBuilder();
            foreach (string s in result)
                sb.AppendLine(s);

            textBoxResult.Text = sb.ToString();

        }

        private void buttonGetDepartures_Click(object sender, EventArgs e)
        {
            ws.setURL(textBoxURL.Text);

            Input input = new Input();

            input.Station = textBoxInput.Text;
            input.StationID = "";

            input.Transfers = "1111111111";

            input.TransfersSelected = "1111111111";

            input.UseTrainsFilter = false;
            input.TrainsFilter = "";

            input.UseDirectionsFilter = false;
            input.DirectionsFilter = "";

            input.UsePlatformsFilter = false;
            input.PlatformsFilter = "";

            textBoxResult.Text = ws.GetDepartures("3FBF5000-7351-0801-1706-8AB2475903EB", input);

        }
    }
}
